<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateElUserShopTable1554107732 extends Migration
{
    /**
     * 门店与会员关系
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $prefix = config('ibrand.app.database.prefix', 'ibrand_');
        if(!Schema::hasTable($prefix.'user_shop')){
	        Schema::create($prefix.'user_shop', function (Blueprint $table) {
		        $table->increments('id');
		        $table->integer('user_id');
		        $table->integer('shop_id');
		        $table->timestamps();
	        });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        $prefix = config('ibrand.app.database.prefix', 'ibrand_');
        Schema::drop($prefix.'user_shop');
    }
}
